package com.tjsinfo.tjsoa.system.action;

import java.io.File;
import java.io.IOException;
import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.tjsinfo.tjsoa.addresslist.bo.IAddressListSystemUserBo;
import com.tjsinfo.tjsoa.addresslist.vo.AddressListSystemUser;
import com.tjsinfo.tjsoa.common.ToolKit;
import com.tjsinfo.tjsoa.fileExpress.bo.IFileExpressGroupBo;
import com.tjsinfo.tjsoa.fileExpress.bo.IFileExpressUserSizeBo;
import com.tjsinfo.tjsoa.fileExpress.vo.TjsUserEmail;
import com.tjsinfo.tjsoa.system.bo.ILianDongBO;
import com.tjsinfo.tjsoa.system.bo.ISystemUserBo;
import com.tjsinfo.tjsoa.system.vo.TSystemUser;

/**
 * 添加用户授权
 * @author Administrator
 *
 */
public class AddChaYueAction extends Action{
	private ISystemUserBo systemUserBo;

	public ISystemUserBo getSystemUserBo() {
		return systemUserBo;
	}

	public void setSystemUserBo(ISystemUserBo systemUserBo) {
		this.systemUserBo = systemUserBo;
	}


	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		try {
			String newuserid = request.getParameter("newuserId");
			String olduserid = request.getParameter("olduserId");
			
			if(newuserid!=null && !"".equals(newuserid)&&olduserid!=null && !"".equals(olduserid)){
				systemUserBo.shouQuan(Integer.parseInt(newuserid), Integer.parseInt(olduserid));				
			}
			
			request.setAttribute("linkurl", "system/user/addChaYueForm.jsp");
			request.setAttribute("message", "system.userSave.message");
			return mapping.findForward("success");
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			request.setAttribute("Exception", e);
			return mapping.findForward("failed");
		}
	}
	
}
